import java.sql.SQLOutput;

public class Main {
    public static void main(String[] args) {
        SampleDisplay sampledisplay = new SampleDisplay();
        sampledisplay.display(new Mobilephon());
        sampledisplay.display(new Radio());//测试收音机
    }
}
//定义出SampleDisplay类，完成三个方法的测试
class SampleDisplay{
    public void display(Soundable s){
        s.playSound();
        s.decreaseVolume();
        s.stopSound();
    }
}

//定义一个接口
interface Soundable {
    void playSound();
    void decreaseVolume();
    void stopSound();
}
//定义出Radio和Mobilephon类
class Mobilephon implements Soundable{
    public void playSound(){
        System.out.println("手机发出来电铃声：叮当 、 叮当");
    }
    @Override
    public void decreaseVolume() {
        System.out.println("已降低手机音量");
    }
    @Override
    public void stopSound() {
        System.out.println("已关闭手机");
    }
}
class Radio implements Soundable{
    @Override
    public void playSound() {
        System.out.println("收音机播放广播：第八套小学生广播体操");
    }
    @Override
    public void decreaseVolume() {
        System.out.println("已降低收音机音量。");
    }
    @Override
    public void stopSound() {
        System.out.println("已关闭收音机。");
    }
}
